package com.xinqi.modules.sys.stats.manager;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinqi.common.mybatis.data.service.BaseService;
import com.xinqi.modules.sys.stats.domain.ClassTeachingDayStEntity;
import com.xinqi.modules.sys.stats.dto.req.ClassTeachingDayStQueryDTO;
import com.xinqi.modules.sys.stats.dto.req.ClassTeachingOverviewQueryDTO;
import com.xinqi.modules.sys.stats.dto.rsp.ClassOverviewResultDTO;
import com.xinqi.modules.sys.stats.dto.rsp.ClassTeachingCountResultDTO;
import com.xinqi.modules.sys.stats.dto.rsp.ClassTeachingDayStResultDTO;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 班级教学数据统计管理层
 *
 * @author: wenjie
 * @date: 2023/08/24
 */
public interface ClassTeachingDayStManager extends BaseService<ClassTeachingDayStEntity> {

    /**
     * 自定义分页查询
     */
    Page<ClassTeachingDayStResultDTO> findPage(Page<Object> pag, String schoolName, LocalDateTime startTime, LocalDateTime endTime);

    /**
     * 自定义列表查询
     */
    List<ClassTeachingDayStResultDTO> findList(ClassTeachingDayStQueryDTO query);

    /**
     * 根据id查询 班级教学数据统计数据
     */
    ClassTeachingDayStEntity findById(Long id);

    /**
     * 根据id删除 班级教学数据统计数据
     */
    @Transactional(rollbackFor = Exception.class)
    boolean deleteById(Long id);

    List<ClassTeachingCountResultDTO> findCourseContentCountByTypeAndCourseClassIdListAndDateRange(Integer type, List<Long> courseClassIdList, LocalDateTime startTime, LocalDateTime endTime);

    List<ClassTeachingCountResultDTO> findCurrentDateReleaseHomeworkByTypeAndCourseClassIdListAndDateRange(Integer type, List<Long> courseClassIdList, LocalDateTime startTime, LocalDateTime endTime);

    ClassOverviewResultDTO overview(ClassTeachingOverviewQueryDTO query);

    IPage<ClassTeachingDayStEntity> findPageBySchoolNameList(Page<ClassTeachingDayStEntity> page, List<String> schoolNameList);

    List<ClassTeachingCountResultDTO> findContentSortListAndDateRange(String schoolName, LocalDateTime startTime, LocalDateTime endTime);
}
